资料
- 硬边缘的阴影效果
- 软化阴影
- 改变偏移量来有效的改变光源的方向
- 浮雕效果
- 使用阴影创建光芒特效
- 使用阴影创建外发光效果
TextView:shadowDx/Dy/Radius in dip?
If it’s not specified then the unit is always in px.
android:shadowDx, shadowRadius 后面的值是dip还是px还是sp ?
not dp,it’s px,用不同尺寸的手机或模拟器试试便知1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21<TextView
android:id="@+id/iv_filter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_filter_selector"
android:gravity="center"
android:padding="8dp"
android:text="@string/filter"
android:textSize="@dimen/font_small_size"
android:textColor="@color/white"
android:shadowColor="#7F000000"
android:shadowDx="8sp"
android:shadowDy="8sp"
android:shadowRadius="6sp"/>
Error:(166, 39) Dimension types not allowed (at 'shadowDx' with value '8sp').
Error:(167, 39) Dimension types not allowed (at 'shadowDy' with value '8sp').
Error:(168, 43) Dimension types not allowed (at 'shadowRadius' with value '6sp').
Error:(166, 39) Dimension types not allowed (at 'shadowDx' with value '8sp').
Error:(167, 39) Dimension types not allowed (at 'shadowDy' with value '8sp').
Error:(168, 43) Dimension types not allowed (at 'shadowRadius' with value '6sp').